cmake_minimum_required(VERSION 3.12)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -frtti")

project("nativelib")

add_definitions("-D_UNIX")


add_subdirectory("yzrutil")
add_subdirectory("SimpleDSP")
add_subdirectory("SimpleSynth")
add_subdirectory("SimpleSynthNative")
include_directories("${PROJECT_SOURCE_DIR}/yzrutil/main")
include_directories("${PROJECT_SOURCE_DIR}/SimpleDSP/main")
include_directories("${PROJECT_SOURCE_DIR}/SimpleSynth/main")

set (OBOE_DIR "${PROJECT_SOURCE_DIR}/../../../../../Reference/Android/oboe-main")
add_subdirectory(${OBOE_DIR} ./oboe-bin)
include_directories(${OBOE_DIR}/include ${OBOE_DIR}/samples/shared)

add_library(nativelib SHARED nativelib.cpp)
find_library(log-lib log)
target_link_libraries(${PROJECT_NAME} ${log-lib} c++_shared android)
target_link_libraries(${PROJECT_NAME} oboe)
target_link_libraries(${PROJECT_NAME} yzrutil)
target_link_libraries(${PROJECT_NAME} SimpleDSP)
target_link_libraries(${PROJECT_NAME} SimpleSynth)
